Improve Resolve-Error
command and allow default system prompt for the openai-gpt
agent
#397
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary
This PR includes the following changes:
Improve
Resolve-Error
$?
doesn't accurately reflect if the last command succeeded or failed. e.g., the last command is a function definition, and it raised parsing errors; the last command has multiple statements and the last command in it succeeded.fixit
immediately after a failure. If they run another command, fixit won't be able to get the last error.This PR changed it to focus on the last error record:
$LastErrorCode
isnull
or0
, then the user should be looking at the last failure from a previous command run (not the very last command run).$LastErrorCode
isnon-zero
and$?
isfalse
, then the last command must be a failing native command.$LastErrorCode
isnon-zero
but$?
istrue
, then it's not unknown which command/failure the user is looking at, so as the agent to look at the terminal content and figure out by itself.Change the temperature to be 0.5. Setting it to 0 make it too rigorous and loose the creativity to solve a task.
Allow a default system prompt to be used when user's system prompt is not specified.